const state={
  address:JSON.parse(uni.getStorageSync('address')||'{}'),
  token:uni.getStorageSync('token')||'12345432123',
  userInfo:JSON.parse(uni.getStorageSync('userinfo')||'{}'),
  // 重定向的object对象
  redirectInfo:null,
};
const actions={};
const mutations={
  UPDATEADDRESS(state,address){
    state.address=address;
    uni.setStorageSync('address',JSON.stringify(state.address));
  },
  UPDATEUSERINFO(state,info){
    state.userInfo=info;
    uni.setStorageSync('userinfo',JSON.stringify(state.userInfo));
  },
  UPDATETOKEN(state,token){
    state.token=token;
    uni.setStorageSync('token',state.token);
  },
  UPDATEREDIRECINFO(state,dirInfo){
    state.redirectInfo=dirInfo;
  }
  
};
const getters={
  addressAll(state){
    return state.address.provinceName+state.address.cityName+state.address.countyName+state.address.detailInfo
  }
};
export default {
  namespaced:true,
  state,
  actions,
  mutations,
  getters
}